<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('主持人订单中心')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                            下单人姓名：<input type="text" name="orderCustomerName"/>
                        </li>
                        <li>
                            下单公司：<input type="text" name="orderCompany"/>
                        </li>
                        <li>
                            主持人姓名：<input type="text" name="orderHostname"/>
                        </li>
<!--                        <li>-->
<!--                            下单时间：<input type="text" name="orderCreatetime"/>-->
<!--                        </li>-->
                        <li class="select-time">
                            <label>下单时间： </label>
                            <input type="text" class="time-input" id="orderCreatetime"  name="params[orderCreatetime]"/>
                        </li>
                        
                        <li>
                            全部状态：
                            <select name="orderState" th:with="type=${@dict.getType('sys_normal_disable')}">
                                <option value="-1">请选择</option>
                                <option value="0">待主持</option>
                                <option value="1">已主持</option>
                                <option value="2">已删除</option>
                            </select>
                        </li>
                        <li>
                            全部角色：
                            <select name="orderRole" th:with="type=${@dict.getType('sys_normal_disable')}">
                                <option value="-1">请选择</option>
                                <option value="1">婚庆公司</option>
                                <option value="2">策划师</option>
                                <option value="3">新人</option>
                                <option value="4">自填订单</option>
                            </select>
                        </li>
                        <li class="select-time">
                            <label>典礼时间： </label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
                        </li>
                        
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="user:order:add">
                <i class="fa fa-plus"></i> 新增
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="user:order:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="user:order:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="user:order:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('user:order:edit')}]];
    var removeFlag = [[${@permission.hasPermi('user:order:remove')}]];
    var datas = [[${@dict.getType('sys_normal_disable')}]];
    var pgFlag = [[${@permission.hasPermi('user:order:permissionset')}]];
    var prefix = ctx + "user/order";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "主持人订单",
            sortOrder: "desc",
            columns: [{
                checkbox: true
            },
                {
                    field: 'orderId',
                    title: '编号',
                    sortable: true
                },
                {
                    field: 'orderCustomerName',
                    title: '下单人姓名'
                },
                {
                    field: 'orderPhone',
                    title: '下单人电话'
                },
                {
                    field: 'orderCompany',
                    title: '下单公司'
                },
                {
                    field: 'orderHostname',
                    title: '主持人'
                },
                {
                    field: 'orderHotel',
                    title: '酒店名称地址'
                },
                {
                    field: 'orderCreatetime',
                    title: '下单时间',
                    sortable: true
                 
                },
                {
                    field: 'orderCeremonydatestart',
                  //  field: 'orderCeremonydatestop',
                    title: '典礼日期',
                    sortable: true
                    
                },
                {
                    field: 'orderCeremonytime',
                    title: '典礼时间',
                    formatter: function (value, row, index) {
                        if (value == 0) {
                            return "<span >全天</span>";
                        }else if(value==1){
                            return "<span >上午</span>";
                        }else{
                            return "<span >下午</span>";
                        }

                    }
                },
                {
                    field: 'orderPrice',
                    title: '金额',
                    sortable: true
                },
                {
                    field: 'orderState',
                    title: '订单状态',
                    formatter: function (value, row, index) {
                        if (value == 0) {
                            return "<span >待主持</span>";
                        }else if(value==1){
                            return "<span style='color:blue;'>已主持</span>";
                        }else{
                            return "<span style='color:red;'>已删除</span>";
                        }
                        
                    }
                },
                {
                    //field:'orderEvaluation',
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-info btn-xs ' + pgFlag + '" href="javascript:void(0)" onclick="permissionSet(\'' + row.orderId + '\')">查看评价</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);

    });
 
    function permissionSet(orderId) {
        var url = prefix + '/permissionset/'+orderId;
        $.modal.open("查看评价", url);
    }
    




</script>
</body>
</html>